#pragma once


// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

// CMaterialPreviewWnd

#include "WorldFollower.h"
#include "UiFollower.h"
#include "SelectionManager.h"


class CMaterialPreviewWnd 
    : public CWnd, public UiFollower, public WorldFollower
{
    DECLARE_DYNAMIC(CMaterialPreviewWnd)

public:

    CMaterialPreviewWnd();
    virtual ~CMaterialPreviewWnd();

    virtual BOOL Create(DWORD dwStyle, const RECT& rect, 
                        CWnd* pParentWnd, UINT nID);

protected:

    HGLRC m_hRC;
    CString m_strWndClass;
    bool m_projValid;

    void MakeCurrent();

    // -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
    // SelectionListener override
    
    void onSelectionChanged(SelectionManager* sender) override;

    // -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

    DECLARE_MESSAGE_MAP()
public:
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnPaint();
    afx_msg void OnClose();
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};


